import { _decorator, Component, Node, Vec3 } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('Bullet')
export class Bullet extends Component {

    private velocity: Vec3 = new Vec3(0, 5)

    private isMove: boolean = true;

    start() {

    }

    update(deltaTime: number) {

        if (!this.isMove) {
            return;
        }

        this.node.setPosition(
            this.node.position.x + this.velocity.x,
            this.node.position.y + 5
        )

        if (this.node.position.y > 260) {
            this.node.destroy();
        }

    }
}


